<?php
/**
 * User: itimphp
 * Date: 6/4/12
 * Time: 11:48 PM
 */
require_once('includes/recaptchalib.php');
$privatekey = "6LdkS9ISAAAAAJyUfyz-tRpCsTIU84A5GmNkox-F";

if (!empty($_POST["recaptcha_challenge_field"]) && !empty($_POST["recaptcha_response_field"])) {
	$resp = recaptcha_check_answer($privatekey,
		$_SERVER["REMOTE_ADDR"],
		$_POST["recaptcha_challenge_field"],
		$_POST["recaptcha_response_field"]);

	if (!$resp->is_valid) {
		// What happens when the CAPTCHA was entered incorrectly
		die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
			"(reCAPTCHA said: " . $resp->error . ")");
	} else {
		die('Submit Successfully!');
	}
}
?>

<html>
<body> <!-- the body tag is required or the CAPTCHA may not show on some browsers -->
<!-- your HTML content -->

<form method="post" action="test_form_recaptcha.php">
	<?php
	require_once('includes/recaptchalib.php');
	$publickey = '6LdkS9ISAAAAAAiOzrgYDSbCgcd9Fw4rutkulGQq'; // you got this from the signup page
	echo recaptcha_get_html($publickey);
	?>
	<input type="submit"/>
</form>

<!-- more of your HTML content -->
</body>
</html>
